export default class FAN {
  constructor(private i2c:any, private Addr = 0x0d) {}
  /*风扇相关变量*/
  private fan = {
    FAN_REG: 0x08  // 风扇地址
  }
  /*风扇相关函数*/
  // 关闭风扇
  public closeFAN() {
    /*地址池开启风扇:0x08 0x09 0x01  关闭风扇:0x00 0x04 0x06*/
    this.i2c.openPromisified(1).then((bus:any) => {
      bus.writeByte(this.Addr, this.fan.FAN_REG, 0x00)
    })
  }
  // 开启风扇
  public openFAN() {
    /*地址池开启风扇:0x08 0x09 0x01  关闭风扇:0x00 0x04 0x06*/
    this.i2c.openPromisified(1).then((bus:any) => {
      bus.writeByte(this.Addr, this.fan.FAN_REG, 0x01)
    })
  }
}